package homework.day03;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class WriteString {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("image_bak.png");
        FileInputStream fis = new FileInputStream("image.png");

        byte[] buf = new byte[1024];

        int len ;
        while((len = fis.read(buf))!=-1){
            fos.write(buf);
        }
        fis.close();
        fos.close();
    }
}
